#include <bits/stdc++.h>
using namespace std;

using i64 = long long;
const int N = 3030, P = 998244353;

int n, m, im, dp[N];

int c[N][N], pm[N], rm[N];

int inv(int b, int k = P - 2) {
    int ret = 1;
    while(k > 0) {
        if(k & 1) ret = ret * (i64)b % P;
        b = (i64)b * b % P;
        k >>= 1;
    }
    return ret;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> m;
    im = inv(m - 1);
    c[0][0] = 1;
    rm[0] = 1;
    for(int i = 1; i <= n; i ++) {
        c[i][0] = 1;
        for(int j = 1; j <= i; j ++)
            c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % P;
        rm[i] = rm[i - 1] * (m - 1ll) % P;
        
        dp[i] = inv(m, i);
        for(int j = 0; j < i; j ++)
            dp[i] = (dp[i] + dp[j] * (i64)rm[j] % P * c[i][j]) % P;
        
        dp[i] = dp[i] * (i64)inv(P + inv(m, i) - inv(m - 1, i)) % P;
        cout << dp[i] << "\n";
    }
    return 0;
}